package com.hspjava.String_;

public class StringMethods02 {
    public static void main(String[] args) {
        String s1 = "lfm";
        String s2 = "llp";

        String s3 = "workstation";
        String s4 = "work";
        String s5 = "station";

        String s6 = "hello";
        String s7 = "guet";
        String s8 = s6.concat(s5);
        System.out.println(s6.concat(s7));
        System.out.println(s8.replace('h', 'e'));

        String s9 = "sdfsd, sdff, gfdghdh, sdfksd";
        String s10 = "aaa\\ccc\\";
        String[] splits = s9.split(", ");
        for (String s:splits ) {
            System.out.println(s);
        }
        String[] splits01 = s10.split("\\\\");
        for (String s:splits01) {
            System.out.println(s);
        }

        String name = "lfm";
        char gener  = '男';
        double grade = 99.99;

        String format = String.format("姓名:%s, 性别:%c, 成绩:%.2f", name, gener, grade);

        System.out.println(format);





        System.out.println();
        System.out.println(s3.indexOf(s5));

        System.out.println(s1.compareTo(s2));
        System.out.println('f' - 'l');

    }
}
